{% extends "base.html" %}

{% block title %}我的TODO列表{% endblock %}

{% block content %}
<div class="page-header">
    <h2>我的任务</h2>
    <a href="{{ url_for('create_todo') }}" class="btn btn-primary">
        <i class="fas fa-plus"></i> 新建任务
    </a>
</div>

<div class="todos-container">
    {% if todos %}
        {% for todo in todos %}
            {% include 'components/todo_card.html' %}
        {% endfor %}
    {% else %}
        <div class="empty-state">
            <i class="fas fa-clipboard-list"></i>
            <h3>还没有任务</h3>
            <p>点击"新建任务"按钮开始创建你的第一个TODO</p>
            <a href="{{ url_for('create_todo') }}" class="btn btn-primary">
                <i class="fas fa-plus"></i> 创建第一个任务
            </a>
        </div>
    {% endif %}
</div>

<div class="stats">
    <div class="stat-card">
        <i class="fas fa-tasks"></i>
        <h3>{{ todos|length }}</h3>
        <p>总任务数</p>
    </div>
    <div class="stat-card">
        <i class="fas fa-check-circle"></i>
        <h3>{{ todos|selectattr('completed')|list|length }}</h3>
        <p>已完成</p>
    </div>
    <div class="stat-card">
        <i class="fas fa-clock"></i>
        <h3>{{ todos|rejectattr('completed')|list|length }}</h3>
        <p>待完成</p>
    </div>
</div>
{% endblock %}